home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_10_04
/
1004090c
< prev
next >
Wrap
Text File
|
1992-02-08
|
321b
|
20 lines
void push(stack *st, int value)
{
if (st->stack_ptr == st->max_stack)
printf("Stack %s is full\n", st->stack_name);
else
st->pstack[st->stack_ptr++] = value;
}
int pop(stack *st)
{
if (st->stack_ptr == 0) {
printf("Stack %s is empty\n", st->stack_name);
return 0;
}
return st->pstack[--st->stack_ptr];
}